<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<style>
#output tr{
	height:20pt;
	text-align:center;
}
.outputHeder{
	background: #6dfff2;
}
</style>
<script type="text/javascript">
function functionSerch(){
		var field = document.getElementById("k_field").value; 
		var word = document.getElementById("k_word").value;
		
		location.href="adminOrderList.do?keyField="+field+"&keyWord="+word;
}
</script>

<table align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#a0a0a0" width="950">

	<table width="200" align="center" border="0" cellspacing="0" cellpadding="2">
		<tr>
			<td align="center">
				<select id="k_field" name="keyField">
					<option value="m_name">구매자</option>
					<option value="b_code">구매코드</option>
				</select>
			</td>
			<td><input type="text" size="16" id="k_word" name="keyWord" /></td>
			<td><input type="button" value="검색" onclick="functionSerch()"/></td>
			<td><input type="button" value="전체보기" onclick="location.href='adminOrderList.do'"/></td>
		</tr>

	</table>
	<br/>

	<table id="output" align="center" width="900" border="0" cellpadding="0" cellspacing="0">
		
		<tr class="outputHeder">
			<td>주문번호</td>
			<td>주문코드</td>
			<td>이름</td>
			<td width="150">주소</td>
			<td>전화번호</td>
			<td>상품분류</td>
			<td>상품명</td>
			<td>주문수량</td>
			<td>주문금액</td>
			<td>결재상태</td>
			<td>배송상태</td>
		</tr>
		
		<c:if test="${count==0 }">
			<tr>
				<td colspan="11" align="center">주문하신 내역이 없습니다.</td>
			</tr>
		</c:if>
		
		<c:forEach var="list" items="${orderList }">
		<tr>
			<td>${list.b_orderno }</td>
			<td>${list.b_code }</td>
			<td>${list.memberCommand.m_name }</td>
			<td width="150">${list.memberCommand.m_address }</td>
			<td>${list.memberCommand.m_phone }</td>
			<td>${list.itemCommand.i_category }</td>
			<td>${list.itemCommand.i_name }</td>
			<td>${list.b_ea	 }</td>
			<td>${list.b_amount	 }</td>
			<td>${list.b_method }</td>
			<td>${list.b_way }</td>
		</tr>
		</c:forEach>
		
		<tr>
			<td align="center" colspan="11">${pagingHtml }</td>
		</tr>
		
	</table>
</table>
